package com.flca.frw.util
{
	import flash.net.URLVariables;
	import flash.net.URLRequest;
	import mx.core.Application;
	//import com.flca.frw.services.domain.UserSessionDto;
	
	public class ReportUtil 
	{
		public static var DOWNLOAD_REPORT_URL:String = "/DownloadReport";
		public static var BASE_URL:String;
		
		public static function getReportArgs(aReportName:String):URLVariables
		{
			var result:URLVariables;
			//var session:UserSessionDto;
			
			result = new URLVariables();
			result.sessionId = Application.application.getUserSession().sessionId;
			result.reportName = aReportName;
			
			return result;
		}
		
		public static function openReportUrl(aArgs:URLVariables):void
		{
		    var url:URLRequest;
		    
		    url = new URLRequest(BASE_URL + DOWNLOAD_REPORT_URL);
			url.method = "GET";
			url.data = aArgs;
			
			Application.application.openUrlInNewWindow(url);
			
			return;
		}
	}
}